package com.weng.bigdata.micro.service.warehouse.adapter.feign;

import com.weng.bigdata.micro.service.common.ServicesConstants;
import com.weng.bigdata.micro.service.warehouse.adapter.fallback.WarehouseExecuteFallBack;
import com.weng.bigdata.micro.service.warehouse.adapter.model.req.ExecuteSqlReq;
import com.weng.framework.core.model.ResponseData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 执行引擎
 * @author wengzhonghui
 * @date 2021/4/2 11:07
 */
@FeignClient(name = ServicesConstants.WAREHOUSE_ADAPTER_API_SERVER_NAME, fallback = WarehouseExecuteFallBack.class, configuration = WarehouseExecuteFallBack.class)
public interface WarehouseExecuteFeignService {

		String URL_PREFIX = "/execute";

		@PostMapping(URL_PREFIX + "/sql")
		ResponseData queryBySqlAndParam(@RequestBody ExecuteSqlReq executeSqlReq);

		@PostMapping(URL_PREFIX + "/sql/async")
		ResponseData queryBySqlAndParamAsync(@RequestBody ExecuteSqlReq executeSqlReq);

}
